import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'main',
      component: () => import('@/views/Main.vue'),
      redirect: '/login',
      children: [
        {
          path: 'home',
          name: 'home',
          component: () => import('@/views/feature/HomeView.vue'),
        },
        {
          path: 'about',
          name: 'about',
          component: () => import('@/views/feature/AboutView.vue'),
        },
        {
          path: 'feature1',
          name: 'feature1',
          component: () => import('@/views/feature/feature1View.vue'),
        },
        {
          path: 'feature2',
          name: 'feature2',
          component: () => import('@/views/feature/feature2View.vue'),
        },
        {
          path: 'feature3',
          name: 'feature3',
          component: () => import('@/views/feature/feature3View.vue'),
        },
      ],
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/log/login.vue')
    }
  ],
})

export default router
